package com.bemes.ecmn.model;

public class ECMNMinAggregator extends ECMNAggregator {

	@Override
	public int getAmountOfEquipment() {
		
		if(m_connectors.isEmpty()) // if zero connector is added then return 0;
		{
			return 0;
		}
		else
		{		
			int numOfEq = m_connectors.get(0).getAmountOfEquipment();
			
			for(int i = 1; i < m_connectors.size(); i++)
			{
				int amountOfEachCon;
				amountOfEachCon = m_connectors.get(i).getAmountOfEquipment();
				
				if(numOfEq > amountOfEachCon)
				{
					numOfEq = amountOfEachCon;
				}
			}
			
			return numOfEq;
		}
	}

}
